//
// Created by ✎﹏ℳ๓独赏 ☆独醉 on 2023/2/23.
#include <stdio.h>

int main(){
    int m,n;
    scanf("%d,%d",&m,&n);
    if(m>n){
        int sum = 0;
        for(int i = n;i<=m;i++){
            sum += i;
        }
        printf("%d",sum);
    }else{
        int sum = 0;
        for(int i = m;i<=n;i++){
            sum += i;
        }
        printf("%d",sum);
    }
    return 0;
}